Skip to content

Conversation

@szuend
Copy link
Contributor

@szuend szuend commented Nov 24, 2025

Rather then adapting on the transport layer, we adapt the puppeteer CDPSession/Connection and make them look like a CDPConnection. The class assumes that callers create a dedicated CDPSession to be used.

The PuppeteerDevToolsConnection installs a generic '*' event listener on all child sessions to funnel all CDP events into DevTools via CDPConnectionObservers. As pointed out in the code comment, we don't need to recursively listen to 'sessionattached' events on child sessions: Nested sessionattached events are reported on all parent sessions.

While not strictly necessary, PuppeteerDevToolsConnection also uninstalls the CDP event listener when a session gets detached (modulo the root puppeteer CDPSession).

@szuend szuend force-pushed the cdp-connection-puppeteer branch from 9c74255 to 911344e Compare November 24, 2025 10:06
@szuend szuend requested a review from OrKoN November 24, 2025 10:06
@szuend szuend enabled auto-merge (squash) November 24, 2025 10:25
@szuend szuend force-pushed the cdp-connection-puppeteer branch from 911344e to 88ebcfa Compare November 24, 2025 10:26
@szuend szuend merged commit eea5b80 into main Nov 24, 2025
20 checks passed
@szuend szuend deleted the cdp-connection-puppeteer branch November 24, 2025 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants